package com.hqyj.shop.service.imp;

import com.hqyj.shop.dao.OrderDao;
import com.hqyj.shop.pojo.Order;
import com.hqyj.shop.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderDao orderDao;

    @Override
    public boolean deleteOneOnOrder(Integer orderId) {
        boolean b = orderDao.deleteOrder(orderId);
        return b;
    }

    //新建
    @Override
    public boolean creatOrder(Order order) {
        boolean a = orderDao.creatOrder(order);
        return a;
    }

    //查询
    @Override
    public List<Order> showOrder(Integer userId) {
        List<Order> orders = orderDao.queryOrder(userId);
        return orders;
    }
    //更改状态
    @Override
    public boolean updateOrderStatus(Integer orderId, String status) {
        boolean b = orderDao.updateOrderStatus(orderId, status);
        return b;
    }
}
